import { useEffect } from 'react';

export function useDocumentTitle(title: string, suffix: string = 'MedSelectHub') {
  useEffect(() => {
    document.title = title ? `${title} | ${suffix}` : suffix;
    return () => {
      document.title = 'MedSelectHub - Healthcare Product Reviews & Buying Guides';
    };
  }, [title, suffix]);
}
